﻿using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;

namespace CPPProject.CPP
{
    /// <summary>
    /// 账号、子账号
    /// </summary>
    [Table("CPPAccount")]
    public class CPPAccount : Entity<int>, IHasCreationTime, IMustHaveTenant, ISoftDelete, ICreationAudited
    {
        public int TenantId { get; set; }
        public DateTime CreationTime { get; set; }
        public long? CreatorUserId { get; set; }
        /// <summary>
        /// 父级ID
        /// </summary>
        public int ParentId { get; set; }
        public bool IsDeleted { get; set; }
        /// <summary>
        /// 用户名
        /// </summary>
        [Required]
        [MaxLength(50)]
        public string UserName { get; set; }
        /// <summary>
        /// 密码
        /// </summary>
        [Required]
        [MaxLength(50)]
        public string Password { get; set; }
        /// <summary>
        /// 所属公司
        /// </summary>
        public long CompanyId { get; set; }
        [ForeignKey("CompanyId")]
        public virtual CPPCompany TCompany { get; set; }
        /// <summary>
        /// 绑定用户（此用户指ABP框架的用户表）
        /// </summary>
        public long? UserId { get; set; }
        /// <summary>
        /// 菜单权限
        /// </summary>
        public string MenuRights { get; set; }

        /*-----6-18增加字段------*/
        /// <summary>
        /// 姓名
        /// </summary>
        [Required]
        [MaxLength(50)]
        public string name { get; set; }
        /// <summary>
        /// 联系方式
        /// </summary>
        [Required]
        [MaxLength(11)]

        public string phone { get; set; }
        /// <summary>
        /// Email
        /// </summary>
        [Required]
        [MaxLength(50)]
        public string Email { get; set; }
        /// <summary>
        /// 最后登录时间
        /// </summary>
        public DateTime? EndLoginTime { get; set; }
        /// <summary>
        /// 微信授权ID
        /// </summary>
        [MaxLength(100)]
        public string WeChtOpenID { get; set; }
        /// <summary>
        /// 账号类型
        /// </summary>
        public string AccountType { get; set; }

    }
}
